﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using AspNetCs.Common;
using AspNetCs.Enumerations.Channel_Enum;
using AspNetCs.Enumerations;
using AspNetCs.Bll;

public partial class AlmsList : BasePage
{
    private int pageSize = 20;
    protected int recodCount = 0;
    private int province = 0;
    private int city = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        DnsRequest.UrlRequestAgentName(out city, out province);
        if (!IsPostBack)
        {
            BindReapter();
        }

    }


    public void BindReapter()
    {
        string cmdText = "select Id,TrueName,AddTime,Almsmoney,ChannelId from Alms " + DnsRequest.WhereString("province", "city", " where ", this.city, this.province) + " order by id desc";
        DataPagesOperate operate = new DataPagesOperate();
        AspNetPager1.PageSize = pageSize;
        operate.BindRepeater(cmdText, AspNetPager1, "id desc", "id", rptList, out recodCount);

    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindReapter();
    }


    public string GetEnumScriptionName(string name)
    {
        Channel_Type channel = (Channel_Type)Enum.Parse(typeof(Channel_Type), name);
        return EnumDescription.GetFieldText(channel);
    }
}
